﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using MovieRental.XmlDataService;
using System.ComponentModel.DataAnnotations;

namespace MovieRental.Entities
{
    [XmlEntity("Movies")]
    [DataContract]
    public class MovieInfo : BaseEntity<Guid>
    {
        private string _title;
        private string _webPage;
        private double _imdbRating;

        public MovieInfo()
        {
            Id = Guid.NewGuid();
        }

        public MovieInfo(Guid id)
        {
            Id = id;
        }

        [DataMember]
        public string Title
        {
            get { return _title; }
            set { SetProperty<string>(ref _title, value, "Title"); }
        }

        [DataMember]
        public string WebPage
        {
            get { return _webPage; }
            set { SetProperty<string>(ref _webPage, value, "WebPage"); }
        }

        [DataMember]
        public double ImdbRating
        {
            get { return _imdbRating; }
            set { SetProperty<double>(ref _imdbRating, value, "ImdbRating"); }
        }
    }
}
